package com.oxygen.design.template.interfaces.impl;

import com.oxygen.design.template.bean.Person;
import com.oxygen.design.template.interfaces.Criteria;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangjie
 * @title: CriteriaMale
 * @description: TODO
 * @date 2022/3/12 10:54 PM
 **/
public class CriteriaMale implements Criteria {

    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> malePersons = new ArrayList<Person>();
        for (Person person : persons) {
            if (person.getGender().equalsIgnoreCase("MALE")) {
                malePersons.add(person);
            }
        }
        return malePersons;
    }

}
